//部分控制器
var app = angular.module('myApp.controllers');

//example首页
app.controller('commentIndex', ["$scope", "utilService", "$rootScope", function ($scope, utilService, $rootScope) {
    /*弹窗索引*/
    $scope.alertIndex = null;
    /*模拟数据*/
    $scope.commentList = [{id:0},{id:1}]
    /*打开弹窗*/
    $scope.openAlert = function (item) {
        utilService.$ionicActionSheet.show({
          buttons: [
            // { text: '<span class="fs-14 color-base">继续关注</span>' },
            { text: '<span class="fs-14 color-red">删除</span>' },
          ],
          cancelText: '<span class="fs-14 color-333">取消</span>',
          buttonClicked: function(index) {
            if (index == 0) {
              console.log('取消关注')
              $.toast("已取消", "cancel");
              return true;
            }
          }
        });
    }

    $scope.$on('$ionicView.beforeEnter', function () {
        //页面刚加载
        utilService.$ionicLoading.show(HX_CONFIG.loadingBase);
    }, false);
    $scope.$on('$ionicView.afterEnter', function () {
        utilService.$rootScope.rootData.title = '我的评论';
        //页面加载完成
        utilService.$ionicLoading.hide();
    }, false);
    $rootScope.$on('$ionicView.beforeLeave', function (e, ion) {
        //页面离开之前
        //alertPopup && alertPopup.close();

    }, false);

}]);
